-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove a panic in normalize middleware #1762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me 👍
CHANGES.md
Outdated
### Fixed | ||
* Removed an occasional `unwrap` on `None` panic in `NormalizePathNormalization`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to unreleased section
is it possible to contrive a test for this? whats the exact condition? |
@robjtede unfortunately my server logs couldn't give me a definitive request URL that triggered it, so I weren't able to reproduce it manually, but it was happening frequently enough to warrant me running a patched version of actix-web. From what I gathered by reading code, this fails when the path is missing either the scheme (no |
I prefer just to merge this rather than to wait for coming up with a suitable test as this is a general improvement. @robjtede Thoughts? |
Codecov Report
@@ Coverage Diff @@
## master #1762 +/- ##
=======================================
Coverage 53.80% 53.80%
=======================================
Files 129 129
Lines 12266 12266
=======================================
Hits 6600 6600
Misses 5666 5666
Continue to review full report at Codecov.
|
Yep it's a sensible change regardless. |
Thanks! |
PR Type
Big Fix
PR Checklist
Overview
Fixes a panic that occurred occasionally when using path normalization middleware. If the original path was empty due to a malformed request,
parts.path_and_query
would beNone
. Actual panic logged on a live system 🙃: